home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000143_icon-group-sender _Tue Jun 22 12:34:32 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA01135
  4.     for icon-group-addresses; Tue, 22 Jun 1999 12:34:24 -0700 (MST)
  5. Message-Id: <199906221934.MAA01135@baskerville.CS.Arizona.EDU>
  6. To: icon-group@optima.CS.Arizona.EDU
  7. Date: Tue, 22 Jun 1999 19:05:11 GMT
  8. From: "Ian Trudel" <ian@monk.cgocable.ca>
  9. Subject: Re: Assertions in Icon
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13. Well, I guess I cannot answer properly to this question since I am not an
  14. Icon programmer. Though, I am studying Icon's implementation and I can tell
  15. you a bit about. First of all, I know that you can use &trace diagnostic
  16. facility for tracing. You could certainly assign a non-zero value to &trace
  17. before evaluate "e" and put it back to zero after (yeah, if it fails, you'd
  18. still have to halt the program). Anyway, Icon implementation is very
  19. straightforward and at worst case, you could implement an assertion
  20. function.
  21.  
  22. Ian
  23.  
  24. Kostas Oikonomou wrote in message
  25. <199906221648.JAA25306@baskerville.CS.Arizona.EDU>...
  26. :
  27. :Hello,
  28. :
  29. :Does anyone have a suggestion about how to implement a procedure "assert",
  30. :which, when called with an expression "e" as argument, implements
  31. :
  32. : e | stop("Assertion on line ", &line, " failed!")
  33. :
  34. :Here &line should be the line on which assert(e) appears.
  35. :Thanks.
  36. :
  37. : Kostas Oikonomou
  38. :
  39. :
  40.  
  41.  
  42.